package com.myway.dto.pricing;

import com.myway.dto.product.DTOProduct;


/**  
* @ClassName: DTOProductOffer  
* @Description: 产品价格DTO
* @author Jiang.Yida
* @date 2015年10月23日 下午1:38:50  
*    
*/
public class DTOProductOffer extends DTOProduct implements Comparable<DTOProductOffer> {
	/**
	 * 
	 */
	private static final long serialVersionUID = 3230583829328277283L;

	/**
	 * Adult Fare
	 */
	private DTOFare adultFare;

	/** Child Fare */
	private DTOFare childFare;

	/** Infant Fare */
	private DTOFare infantFare;
	
	/**
	 * 国际票成人价
	 */
//	private DTOIntlFare adultFareIntl;
	/** 
	 * 国际票儿童价
	 */
//	private DTOIntlFare childFareIntl;
	/**
	 * 国际票婴儿价 
	 */
//	private DTOIntlFare infantFareIntl;	
	
	
	/**
	 * 推荐的
	 */
	private boolean recommended=false;
	
	/**
	 * Additional information for this product offer. Value to be set by rules.
	 */
	private String remark;
	/**
	 * 用户表示，注明是使用哪种用户进行查询的
	 */
	private String userTypeMark = "";
	/**
	 * FareLock product lock fee
	 * @return
	 */
//	private List<DTOFareLock> fareLocks = new ArrayList<DTOFareLock>();

	public DTOFare getAdultFare() { 
		return adultFare;
	}

	public void setAdultFare(DTOFare adultFare) {
		this.adultFare = adultFare;
	}

	public DTOFare getChildFare() {
		return childFare;
	}

	public void setChildFare(DTOFare childFare) {
		this.childFare = childFare;
	}

	public DTOFare getInfantFare() {
		return infantFare;
	}

	public void setInfantFare(DTOFare infantFare) {
		this.infantFare = infantFare;
	}

	public int compareTo(DTOProductOffer o) {
		double t1 = this.getAdultFare().getTotal();
		double t2 = o.getAdultFare().getTotal();
		if (t1 < t1) {
			return -1;
		} else if (t1 > t2) {
			return 1;
		} else {
			return 0;
		}
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public void offerAdultFare(double fare) {
		if (adultFare == null) {
			adultFare = new DTOFare();
		}
		adultFare.setFarePrice(fare);
	}
	
	public void offerChildFare(double fare) {
		if (childFare == null) {
			childFare = new DTOFare();
		}
		childFare.setFarePrice(fare);
	}
	
	public void offerInfantFare(double fare) {
		if (infantFare == null) {
			infantFare = new DTOFare();
		}
		infantFare.setFarePrice(fare);
	}

	/**
	 * @return the recommended
	 */
	public boolean isRecommended() {
		return this.recommended;
	}

	/**
	 * @param recommended the recommended to set
	 */
	public void setRecommended(boolean recommended) {
		this.recommended = recommended;
	}

//	public DTOIntlFare getAdultFareIntl() {
//		return adultFareIntl;
//	}
//
//	public void setAdultFareIntl(DTOIntlFare adultFareIntl) {
//		this.adultFareIntl = adultFareIntl;
//	}
//
//	public DTOIntlFare getChildFareIntl() {
//		return childFareIntl;
//	}
//
//	public void setChildFareIntl(DTOIntlFare childFareIntl) {
//		this.childFareIntl = childFareIntl;
//	}
//
//	public DTOIntlFare getInfantFareIntl() {
//		return infantFareIntl;
//	}
//
//	public void setInfantFareIntl(DTOIntlFare infantFareIntl) {
//		this.infantFareIntl = infantFareIntl;
//	}
//	
//	public void offerAdultFare(double fare, Currency unit){
//		if(adultFareIntl == null){
//			adultFareIntl = new DTOIntlFare();
//		}
//		
//		adultFareIntl.setFarePrice(new DTOPriceUnit(fare,unit));
//	}
//	
//	public void offerChildFare(double fare, Currency unit){
//		if(childFareIntl == null){
//			childFareIntl = new DTOIntlFare();
//		}
//		childFareIntl.setFarePrice(new DTOPriceUnit(fare,unit));
//	}
//	
//	public void offerInfantFare(double fare, Currency unit){
//		if(infantFareIntl == null){
//			infantFareIntl = new DTOIntlFare();
//		}
//		infantFareIntl.setFarePrice(new DTOPriceUnit(fare,unit));
//	}	
	
//	public void offerLockFare(int start, int end, double fare){
//	DTOFareLock fareLock = new DTOFareLock();
//	fareLock.setStart(start);
//	fareLock.setEnd(end);
//	fareLock.setLockFee(fare);
//	
//	fareLocks.add(fareLock);
//}


	public String getUserTypeMark() {
		return userTypeMark;
	}

	public void setUserTypeMark(String userTypeMark) {
		this.userTypeMark = userTypeMark;
	}
	
	
}
